
#ifndef TRICK_H
#define TRICK_H

#include "Card.h"
#include "Player.h"
#include "PropChangeSupport.h"
namespace SHGame {
	using namespace SHGame::Events;
	using namespace System::Collections::Generic;
	/*
	A trick is a collection of cards, each card is played by a player.
	*/
	public ref class Trick
	{
	public:
		static const int NUM_PLAYERS = 5;
	private:
		Player^ leader;
		Dictionary<Player^, Card^>^ map;
		
	public:
		/*
		Creates a new trick with the given player & card
		as the leader & lead. 
		*/
		Trick(Player^ leader, Card^ lead);

		/*
		Adds the given player to this trick, having played the
		given card. This means that the player played the card.
		Returns true if the card was played. If, for example,
		the player has already played on this trick or all 5 players
		have played, this does nothing and returns false.
		*/
		bool play(Player^, Card^);
		/*
		Gets the card played by the given player.
		Returns null if the player has not played.
		*/
		Card^ get(Player^);
		/*
		Gets the player that played the given card.
		Returns null if the card has not been player
		*/
		Player^ get(Card^ c);
		/*
		Checks if the given player has played. Returns true
		if the played played, else false. ("playing" means adding
		the player and card using the add method).
		*/
		bool played(Player^);
		/*
		Gets the first card played. This is the card that other
		players must follow suit with. 
		*/
		Card^ getLead();

		Player^ getLeader();
		/*
		Gets the number of points on this trick.
		*/
		int getPoints();

		Player^ getOwner();
		bool Finished();
	};
}


#endif